import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'
import Product from '../views/Product'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'Layout',
    component:Layout,
    children:[
      {
        path:'/',
        name:'Product',
        component:Product
      },
      {
        path:'/params',
        name:'Params',
        component:()=>import("../views/Params")
      },
      {
        path:'/content',
        name:'Content',
        component:()=>import("../views/Content")
      }
    ]
  },
  {
    path:"/login",
    name:"Login",
    component:()=>import("../views/Login.vue")
  },
  {
    path:'/ucenter',
    name:'UCenter',
    component:()=>import('../views/UCenter.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
